class UserDetailModel {
  String? id;
  String? userName;
  String? loginName;
  dynamic gender;
  dynamic politics;
  String? telephone;
  dynamic fixedphone;
  dynamic birthday;
  dynamic education;
  dynamic headUrl;
  dynamic remark;
  dynamic userIdentity;
  dynamic userCategory;
  String? orgId;
  String? orgName;
  String? orgAlias;
  String? orgFunction;
  String? orgType;
  String? tenantId;
  List<String>? appCodes;
  int? userStatus;
  dynamic nation;
  dynamic postDuty;
  DateTime? postDate;
  String? occurrenceTime;
  String? occurrenceTimeType;
  int? userType;

  UserDetailModel({
    this.id,
    this.userName,
    this.loginName,
    this.gender,
    this.politics,
    this.telephone,
    this.fixedphone,
    this.birthday,
    this.education,
    this.headUrl,
    this.remark,
    this.userIdentity,
    this.userCategory,
    this.orgId,
    this.orgName,
    this.orgAlias,
    this.orgFunction,
    this.orgType,
    this.tenantId,
    this.appCodes,
    this.userStatus,
    this.nation,
    this.postDuty,
    this.postDate,
    this.occurrenceTime,
    this.occurrenceTimeType,
    this.userType,
  });

  factory UserDetailModel.fromJson(Map<String, dynamic> json) {
    return UserDetailModel(
      id: json['id'] as String?,
      userName: json['userName'] as String?,
      loginName: json['loginName'] as String?,
      gender: json['gender'] as dynamic,
      politics: json['politics'] as dynamic,
      telephone: json['telephone'] as String?,
      fixedphone: json['fixedphone'] as dynamic,
      birthday: json['birthday'] as dynamic,
      education: json['education'] as dynamic,
      headUrl: json['headUrl'] as dynamic,
      remark: json['remark'] as dynamic,
      userIdentity: json['userIdentity'] as dynamic,
      userCategory: json['userCategory'] as dynamic,
      orgId: json['orgId'] as String?,
      orgName: json['orgName'] as String?,
      orgAlias: json['orgAlias'] as String?,
      orgFunction: json['orgFunction'] as String?,
      orgType: json['orgType'] as String?,
      tenantId: json['tenantId'] as String?,
      appCodes: (json['appCodes'] as List).cast<String>(),
      userStatus: json['userStatus'] as int?,
      nation: json['nation'] as dynamic,
      postDuty: json['postDuty'] as dynamic,
      postDate: json['postDate'] == null
          ? null
          : DateTime.parse(json['postDate'] as String),
      occurrenceTime: json['occurrenceTime'] as String?,
      occurrenceTimeType: json['occurrenceTimeType'] as String?,
      userType: json['userType'] as int?,
    );
  }

  Map<String, dynamic> toJson() => {
        'id': id,
        'userName': userName,
        'loginName': loginName,
        'gender': gender,
        'politics': politics,
        'telephone': telephone,
        'fixedphone': fixedphone,
        'birthday': birthday,
        'education': education,
        'headUrl': headUrl,
        'remark': remark,
        'userIdentity': userIdentity,
        'userCategory': userCategory,
        'orgId': orgId,
        'orgName': orgName,
        'orgAlias': orgAlias,
        'orgFunction': orgFunction,
        'orgType': orgType,
        'tenantId': tenantId,
        'appCodes': appCodes,
        'userStatus': userStatus,
        'nation': nation,
        'postDuty': postDuty,
        'postDate': postDate?.toIso8601String(),
        'occurrenceTime': occurrenceTime,
        'occurrenceTimeType': occurrenceTimeType,
        'userType': userType,
      };
}
